package com.usian.controller;

import com.usian.mapper.TbItemParamMapper;
import com.usian.pojo.TbItemParam;
import com.usian.pojo.TbItemParamItem;
import com.usian.service.TbItemParamService;
import com.usian.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ItemParamController {

    @Autowired
    private TbItemParamService tbItemParamService;


    @RequestMapping("selectItemParamByItemCatId/{itemCatId}")
    public TbItemParam selectItemParamByItemCatId(@PathVariable(value = "itemCatId") Integer itemCatId){
      return tbItemParamService.selectItemParamByItemCatId(itemCatId);
    }

    @RequestMapping("selectItemParamAll")
    public PageResult selectItemParamAll(){
        return tbItemParamService.selectItemParamAll();
    }

    @RequestMapping("insertItemParam")
    public Boolean insertItemParam(Long itemCatId, String[] paramData){
        return tbItemParamService.insertItemParam(itemCatId,paramData);
    }

    @RequestMapping("deleteItemParamById")
    Boolean deleteItemParamById(Long id){
        return tbItemParamService.deleteItemParamById(id);
    }

    @RequestMapping("selectTbItemParamItemByItemId")
    TbItemParamItem selectTbItemParamItemByItemId(Long itemId){
        return tbItemParamService.selectTbItemParamItemByItemId(itemId);
    }

}
